﻿namespace EFS.RC.SupervisorCentral.Controls.Agents
{
	/// <summary>
	/// Interaction logic for SkilledColor.xaml
	/// </summary>
	public partial class SkilledColor : System.Windows.Controls.UserControl
	{
		public SkilledColor()
		{
			InitializeComponent();

			// default
			SkilledValue = 0;
		}

		/// Get skill color
		public static System.Windows.Media.Color GetSkilledColor(
			System.Int32 skilledValue)
		{
			// Skilled
			System.Windows.Media.Color retValue = System.Windows.Media.Colors.GreenYellow;

			// MediumSkilled
			if (skilledValue <= 6)
			{
				retValue = System.Windows.Media.Colors.Orange;
			}

			// NotSkilled
			if (skilledValue <= 3)
			{
				retValue = System.Windows.Media.Colors.Red;
			}

			// ok
			return retValue;
		}

		/// Property SkilledValue: Set
		public System.Int32 SkilledValue
		{
			set
			{
				ellipse.ToolTip = value;
				ellipse.Stroke = new System.Windows.Media.SolidColorBrush(GetSkilledColor(value));
				ellipse.Fill = ellipse.Stroke;
			}
		}
	}
}